$(function(){
//立即执行以下内容
function UrlSearch() 
{
   var name,value; 
   var str=location.href; //取得整个地址栏
   var num=str.indexOf("?") 
   str=str.substr(num+1); //取得所有参数   stringvar.substr(start [, length ]

   var arr=str.split("&"); //各个参数放到数组里
   for(var i=0;i < arr.length;i++){ 
    num=arr[i].indexOf("="); 
    if(num>0){ 
     name=arr[i].substring(0,num);
     value=arr[i].substr(num+1);
     this[name]=value;
     } 
    } 
} 
var Request=new UrlSearch(); //实例化
var list_page_now='list_page'+Request.list_page;
document.getElementById(list_page_now).className = 'btn btn-white  active';
//立即执行结束
});
function list_page_go(list_page) 
{
   var list_page_url='index.php?m=plus&c=plus_home&a=home_plus_list&list_page='+list_page;
   self.location=list_page_url;
}
function list_page_to() 
{
   var list_page = $('#list_page_to').val();
   var list_page_url='index.php?m=plus&c=plus_home&a=home_plus_list&list_page='+list_page;
   self.location=list_page_url;
}
function sousuo() 
{
   var sousuokey = $('#sousuokey').val();
   var list_page_url='index.php?m=plus&c=plus_home&a=home_plus_list&sousuokey='+sousuokey;
   self.location=list_page_url;
}
function plus_all() 
{
   var plus_all_url='index.php?m=plus&c=plus_home&a=home_plus_list';
   self.location=plus_all_url;
}
function plus_type(plus_type) 
{
   var plus_type_url='index.php?m=plus&c=plus_home&a=home_plus_list&plus_type='+plus_type;
   self.location=plus_type_url;
}
function add_plus(plus_id) 
{
	var add_plus_botlist = $.ajax({
        type: "POST",
        url: "index.php?m=plus&c=plus_home&a=home_plus_add",
        data: "plus_id="+plus_id,
        async: false
    }).responseText;
	layer.open({
		title: '选择要应用的机器人',
		type: 1,
		skin: 'layui-layer-rim', //加上边框
		area: ['460px', '90px'], //宽高
		content: add_plus_botlist,
	});
}
function add_plus_do(plus_id) 
{
	var bot_id = $('#home_plus_add_botlist option:selected').val();
	var add_plus_do_echo = $.ajax({
        type: "POST",
        url: "index.php?m=plus&c=plus_home&a=home_plus_add_do",
        data: "plus_id="+plus_id+"&bot_id="+bot_id,
        async: false
    }).responseText;
	parent.layer.msg(add_plus_do_echo);
}